<?php


namespace App\Http\Controllers\Api;


use App\Http\Controllers\Controller;
use App\Http\Requests\LoginRequest;
use App\Services\LoginService;

class LoginController extends Controller
{


    /**
     * 登陆
     * @param LoginRequest $request
     * @param LoginService $service
     * @return LoginController|\Illuminate\Http\JsonResponse
     * @throws \App\Exceptions\BobException
     * @Author 姿势就是力量
     */
    public function login(LoginRequest $request, LoginService $service)
    {
        $userName = (string)$request->post('user_name');
        $password = (string)$request->post('password');
        $res = $service->companyLogin($userName, $password);

        return $this->sendJson($res);
    }

}
